package com.sjg.sys.service;

import com.sjg.sys.entity.SysOperatLog;
import com.sjg.sys.entity.SysOrganization;
import com.sjg.sys.utils.CommUtil;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

import com.sjg.sys.dao.SysOrganizationDao;

@Service
public class SysOrganizationService{

    @Resource
    private SysOrganizationDao sysOrganizationDao;

    public int insert(SysOrganization pojo){
        pojo.setId(CommUtil.getPrimaryKey());
        return sysOrganizationDao.insert(pojo);
    }
    public int delete(Long id){
        return sysOrganizationDao.delete(id);
    }
    public int insertSelective(SysOrganization pojo){
        pojo.setId(CommUtil.getPrimaryKey());
        return sysOrganizationDao.insertSelective(pojo);
    }

    public int insertList(List<SysOrganization> pojos){
        for(SysOrganization organization:pojos){
            organization.setId(CommUtil.getPrimaryKey());
        }
        return sysOrganizationDao.insertList(pojos);
    }

    public int update(SysOrganization pojo){
        return sysOrganizationDao.update(pojo);
    }

    public List<SysOrganization> selectbyOrganization(SysOrganization pojo){
        return sysOrganizationDao.findbyOrganization(pojo);
    }
}
